package org.ddd.orderdemo.application.event.center;

import com.google.common.eventbus.EventBus;

public class EventBusCenter {

    private static EventBus getEventBus(){
        return EventBusHolder.getINSTANCE();
    }

    public static void post(Object event){
        getEventBus().post(event);
    }

    public static void register(Object object){
        getEventBus().register(object);
    }


    static final class EventBusHolder {
        static final EventBus INSTANCE = EventBusFactory.createEventBus();

        static EventBus getINSTANCE() {
            return INSTANCE;
        }
    }

}
